﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DLM.Domain.Model;
using DLM.Domain.Repositories;
using DLM.Infrastructure.UnitOfWork;
using DLM.Infrastructure.Domain;
using Webdiyer.WebControls.Mvc;

namespace DLM.Data.EF.CodeFirst.Repositories
{
    public class BonusLogRepository : Repository<BonusLog, int>, IBonusLogRepository
    {
        public BonusLogRepository(IUnitOfWork unitOfWork)
            : base(unitOfWork)
        { 
        }

        public override IEnumerable<BonusLog> FindAll(System.Linq.Expressions.Expression<Func<BonusLog, bool>> query, int index, int count)
        {
            return this.ActiveContext.BonusLog.Where(query).OrderByDescending(b => b.CreateDate).ToPagedList(index, count);
        }
    }
}
